#ifndef _SCOPED_CALLBACK_H_
#define _SCOPED_CALLBACK_H_

#include <functional>

class ScopedCallback{
	std::function<void()> function_;
private:
	ScopedCallback(const ScopedCallback&);
	ScopedCallback& operator=(const ScopedCallback&);
public:
	explicit ScopedCallback(std::function<void()>&& f):function_(std::move(f)){}
	~ScopedCallback(){function_();}
};

#endif